package com.wetao.lib_common.bean.vo;

import android.os.Parcel;
import android.os.Parcelable;

public class AnswerUiDataListen implements Parcelable{
    private long id;
    private String listenFileUrl;
    private int listenFileDuration; //单位 秒
    private int curTime = 0; //单位 毫秒
    private boolean isPlay = false;


    public AnswerUiDataListen() {

    }

    public AnswerUiDataListen(long id, String listenFileUrl, int listenFileDuration, int curTime, boolean isPlay) {
        this.id = id;
        this.listenFileUrl = listenFileUrl;
        this.listenFileDuration = listenFileDuration;
        this.curTime = curTime;
        this.isPlay = isPlay;
    }

    public static Creator<AnswerUiDataListen> getCREATOR() {
        return CREATOR;
    }

    public static final Creator<AnswerUiDataListen> CREATOR = new Creator<AnswerUiDataListen>() {
        @Override
        public AnswerUiDataListen createFromParcel(Parcel in) {
            return new AnswerUiDataListen(in);
        }

        @Override
        public AnswerUiDataListen[] newArray(int size) {
            return new AnswerUiDataListen[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    protected AnswerUiDataListen(Parcel in) {
        readFromParcel(in);
    }

    @Override
    public void writeToParcel(Parcel out, int flags) {
        out.writeLong(id);
        out.writeString(listenFileUrl);
        out.writeInt(listenFileDuration);
        out.writeInt(curTime);
        out.writeString(String.valueOf(isPlay));
    }

    private void readFromParcel(Parcel in) {
        id = in.readLong();
        listenFileUrl = in.readString();
        listenFileDuration = in.readInt();
        curTime = in.readInt();
        isPlay = Boolean.valueOf(in.readString());
    }


    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getListenFileUrl() {
        return listenFileUrl;
    }

    public void setListenFileUrl(String listenFileUrl) {
        this.listenFileUrl = listenFileUrl;
    }

    public int getListenFileDuration() {
        return listenFileDuration;
    }

    public void setListenFileDuration(int listenFileDuration) {
        this.listenFileDuration = listenFileDuration;
    }

    public int getCurTime() {
        return curTime;
    }

    public void setCurTime(int curTime) {
        this.curTime = curTime;
    }

    public boolean isPlay() {
        return isPlay;
    }

    public void setPlay(boolean play) {
        isPlay = play;
    }

    @Override
    public String toString() {
        return ", id = " + id
                + ", listenFileUrl = " +listenFileUrl
                + ", isPlay = " +isPlay
                + ", curTime = " +curTime
                ;
    }
}
